using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessPlatform.Core;
using BusinessPlatform.Core.BusinessObject;
using BusinessPlatform.Core.BusinessObject.Mapping;
using BusinessPlatform.Core.BusinesObjectType;

namespace BusinessPlatform.Test.SalesOrder
{
    /// <summary>
    /// 销售订单行
    /// </summary>
    public class SalesOrderLine : BusinessObjectBase, ISalesOrderLine , IDocumentLine
    {
        /// <summary>
        /// 销售订单行
        /// </summary>
        public override string TableName
        {
            get { return "SalesOrderLines"; }
        }
        #region properties
        
        /// <summary>
        /// 单据编号
        /// </summary>
        [PropertyMapping(FieldName = "DocEntry", DbType = typeof(Int32), IsPrimary = true)]
        public System.Int32 DocumentEntry
        {
            get { return this.GetPropertyValue<System.Int32>("DocumentEntry"); }
            set { this.SetPropertyValue<System.Int32>("DocumentEntry", value); }
        }
        
        /// <summary>
        /// 行号
        /// </summary>
        [PropertyMapping(FieldName = "LineNum", DbType = typeof(Int32), IsUnionKey = true)]
        public System.Int32 LineNumber
        {
            get { return this.GetPropertyValue<System.Int32>("LineNumber"); }
            set { this.SetPropertyValue<System.Int32>("LineNumber", value); }
        }
        
        /// <summary>
        /// 顺序号
        /// </summary>
        [PropertyMapping(FieldName = "VisOrder", DbType = typeof(Int32))]
        public System.Int32 VisilbeOrder
        {
            get { return this.GetPropertyValue<System.Int32>("VisilbeOrder"); }
            set { this.SetPropertyValue<System.Int32>("VisilbeOrder", value); }
        }

        /// <summary>
        /// 对象
        /// </summary>
        [PropertyMapping(FieldName = "ObjType", DbType = typeof(String))]
        public System.String ObjectType
        {
            get { return this.GetPropertyValue<System.String>("ObjectType"); }
            set { this.SetPropertyValue<System.String>("ObjectType", value); }
        }

        /// <summary>
        /// 行状态
        /// </summary>
        [PropertyMapping(FieldName = "LineStatus", DbType = typeof(String))]
        public BusinessPlatform.Data.Enumerator.BOLineStatus LineStatus
        {
            get { return this.GetPropertyValue<BusinessPlatform.Data.Enumerator.BOLineStatus>("LineStatus"); }
            set { this.SetPropertyValue<BusinessPlatform.Data.Enumerator.BOLineStatus>("LineStatus", value); }
        }
        
        /// <summary>
        /// 已取消
        /// </summary>
        [PropertyMapping(FieldName = "Canceled", DbType = typeof(String))]
        public BusinessPlatform.Data.Enumerator.BOYesOrNo Canceled
        {
            get { return this.GetPropertyValue<BusinessPlatform.Data.Enumerator.BOYesOrNo>("Canceled"); }
            set { this.SetPropertyValue<BusinessPlatform.Data.Enumerator.BOYesOrNo>("Canceled", value); }
        }
        
        /// <summary>
        /// 已关闭
        /// </summary>
        [PropertyMapping(FieldName = "Closed", DbType = typeof(String))]
        public BusinessPlatform.Data.Enumerator.BOYesOrNo Closed
        {
            get { return this.GetPropertyValue<BusinessPlatform.Data.Enumerator.BOYesOrNo>("Closed"); }
            set { this.SetPropertyValue<BusinessPlatform.Data.Enumerator.BOYesOrNo>("Closed", value); }
        }
        
        /// <summary>
        /// 创建人
        /// </summary>
        [PropertyMapping(FieldName = "Creator", DbType = typeof(Int32))]
        public System.Int32 Creator
        {
            get { return this.GetPropertyValue<System.Int32>("Creator"); }
            set { this.SetPropertyValue<System.Int32>("Creator", value); }
        }
        
        /// <summary>
        /// 创建时间
        /// </summary>
        [PropertyMapping(FieldName = "CreateDate", DbType = typeof(DateTime))]
        public System.DateTime CreateDate
        {
            get { return this.GetPropertyValue<System.DateTime>("CreateDate"); }
            set { this.SetPropertyValue<System.DateTime>("CreateDate", value); }
        }
        
        /// <summary>
        /// 更新人
        /// </summary>
        [PropertyMapping(FieldName = "Updator", DbType = typeof(Int32))]
        public System.Int32 Updator
        {
            get { return this.GetPropertyValue<System.Int32>("Updator"); }
            set { this.SetPropertyValue<System.Int32>("Updator", value); }
        }
        
        /// <summary>
        /// 更新时间
        /// </summary>
        [PropertyMapping(FieldName = "UpdateDate", DbType = typeof(DateTime))]
        public System.DateTime UpdateDate
        {
            get { return this.GetPropertyValue<System.DateTime>("UpdateDate"); }
            set { this.SetPropertyValue<System.DateTime>("UpdateDate", value); }
        }
        
        /// <summary>
        /// 备注
        /// </summary>
        [PropertyMapping(FieldName = "Remarks", DbType = typeof(String))]
        public System.String Remarks
        {
            get { return this.GetPropertyValue<System.String>("Remarks"); }
            set { this.SetPropertyValue<System.String>("Remarks", value); }
        }
        
        /// <summary>
        /// 物料编码
        /// </summary>
        [PropertyMapping(FieldName = "ItemCode", DbType = typeof(String))]
        public System.String ItemCode
        {
            get { return this.GetPropertyValue<System.String>("ItemCode"); }
            set { this.SetPropertyValue<System.String>("ItemCode", value); }
        }
        
        /// <summary>
        /// 物料描述
        /// </summary>
        [PropertyMapping(FieldName = "ItemName", DbType = typeof(String))]
        public System.String ItemName
        {
            get { return this.GetPropertyValue<System.String>("ItemName"); }
            set { this.SetPropertyValue<System.String>("ItemName", value); }
        }
        
        /// <summary>
        /// 价格
        /// </summary>
        [PropertyMapping(FieldName = "Price", DbType = typeof(Decimal))]
        public System.Decimal Price
        {
            get { return this.GetPropertyValue<System.Decimal>("Price"); }
            set { this.SetPropertyValue<System.Decimal>("Price", value); }
        }
        
        /// <summary>
        /// 数据
        /// </summary>
        [PropertyMapping(FieldName = "Quantity", DbType = typeof(Decimal))]
        public System.Decimal Quantity
        {
            get { return this.GetPropertyValue<System.Decimal>("Quantity"); }
            set { this.SetPropertyValue<System.Decimal>("Quantity", value); }
        }
        
        /// <summary>
        /// 行总计
        /// </summary>
        [PropertyMapping(FieldName = "LineTotal", DbType = typeof(Decimal))]
        public System.Decimal LineTotal
        {
            get { return this.GetPropertyValue<System.Decimal>("LineTotal"); }
            set { this.SetPropertyValue<System.Decimal>("LineTotal", value); }
        }
        
        #endregion
        
        /// <summary>
        /// 销售订单行构造函数
        /// </summary>
        public SalesOrderLine()
        {
            
        }
    }
}
